﻿@model vngoodlife.Member

@{
    ViewBag.Title = "EditAdmin";
}



<div class="onecolumn">
    <div class="header">
        <span>Thông tin của @Model.FullName</span>
        <div class="switchbutton">
           <a href="@Url.Action("AdminList_BackEnd", "Admin")" class="button">Danh sách Admin</a>
        </div>
        <div class="switchbutton">
                <a href="@Url.Action("CreateAdmin", "Admin")" class="button">Thêm mới Admin</a>
        </div>
        <div class="switchbutton">
           @using (Html.BeginForm("RandomPasswordForMember", "Admin", FormMethod.Post))
            {
                @Html.AntiForgeryToken(vngoodlife.Util.AntiKey.EditSalt)
                <input type="submit" value="Tạo mật khẩu mới" style="margin: -15px 140px 0 0;" onclick="javascript: if (confirm('Bạn muốn đổi mật khẩu cho @Model.FullName?')) { window.location.href='#' } else { return false; };"/> 
               @Html.Hidden("memberName", Model.MemberName);
            }

        </div>
    </div>
    <br class="clear" />
    <div class="content">

        <div class="display-label error">
            <div class="errorcontent">
                <p>@Html.ValidationMessage("NoticePage")</p>
                
                <p>@Html.ValidationMessageFor(model => model.FullName)</p>
                <p>@Html.ValidationMessageFor(model => model.Nick)</p>
                <p>@Html.ValidationMessageFor(model => model.Email)</p>
                <p>@Html.ValidationMessageFor(model => model.Address)</p>
                <p>@Html.ValidationMessageFor(model => model.Phone)</p>
                <p>@Html.ValidationMessageFor(model => model.SocialNumber)</p>
                <p>@Html.ValidationMessageFor(model => model.Birthday)</p>
            </div>
        </div>

        @using (Html.BeginForm("AdminEditSubmit", "Admin", FormMethod.Post, new { id = "AdminEditSubmit", enctype = "multipart/form-data" }))
        {
            @Html.AntiForgeryToken(vngoodlife.Util.AntiKey.EditSalt)
            @Html.ValidationSummary(true)
    
        <img src="../../../Content/images/member/@Model.Avatar" alt="@Model.Avatar" title="@Model.FullName" class="img_AdminAvatar" />
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.MemberName):</label><br />
                       @Html.TextBoxFor(model => model.MemberName, new { Maxlength = "20", ReadOnly = "True" })
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.FullName):</label><br />
                       @Html.TextBoxFor(model => model.FullName, new { Maxlength = "50" })
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.Nick):</label><br />
                       @Html.EditorFor(model => model.Nick, new { Maxlength = "50" })
            </div>

        </div>
        @*<div style="width: 192px;height: 192px;margin-left: 0px;">*@
            
       @* </div>*@
            
        <br class="clear" />
        <br />
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.Email):</label><br />
                       @Html.TextBoxFor(model => model.Email, new { Maxlength = "200" })
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.Address):</label><br />
                       @Html.TextBoxFor(model => model.Address, new { Maxlength = "250" })
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.Phone):</label><br />
                       @Html.TextBoxFor(model => model.Phone, new { Maxlength = "15" })
            </div>


        </div>
        <br class="clear" />
        <br />
            
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.GenderID):</label><br />
                       @Html.DropDownListFor(model => model.GenderID, ViewBag.SexOfAdmin as SelectList)
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.RoleID):</label><br />
                       @Html.DropDownListFor(model => model.RoleID, ViewBag.RoleOfAdmin as SelectList)
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.IsActive):</label><br />
                       @Html.EditorFor(model => model.IsActive)
            </div>
        </div>
        <br class="clear" />
        <br />
            
        <div>

            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.SocialNumber):</label><br />
                       @Html.TextBoxFor(model => model.SocialNumber, new { Maxlength = "10" })
            </div>

            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.Birthday):</label><br />
                       @Html.EditorFor(model => model.Birthday, new { Maxlength = "10" })
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.ShowBirthday):</label><br />
                       @Html.EditorFor(model => model.ShowBirthday)
            </div>
        </div>
        <br class="clear" />
        <br />
            
        <div>

            <div style ="float: left;width: 652px;">
                <label>@Html.LabelFor(model => model.Introduction):</label><br />
                       @Html.TextAreaFor(model => model.Introduction, new { Maxlength = "10000", Style = "Width: 640px;" })
            </div>

            <div class="editor_right2">
                <label>@Html.LabelFor(model => model.IsShowIntroduction):</label><br />
                       @Html.EditorFor(model => model.IsShowIntroduction)
            </div>

        </div>
        <br class="clear" />
        <br />
            
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.Avatar):</label><br />
                <input name="uploadFile" id="uploadFile" type="file" />
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.MemberStatus):</label><br />
                       @Html.TextBoxFor(model => model.MemberStatus, new { Maxlength = "500" })
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.IsFullInformation):</label><br />
                       @Html.EditorFor(model => model.IsFullInformation)
            </div>

        </div>
        <br class="clear" />
        <br />
            
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.Watch):</label><br />
                       @Html.Raw(Model.Watch)
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.WatchDate):</label><br />
                       @(vngoodlife.Util.GeneralClass.ConvertDate_1B(Model.WatchDate))
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.IsShowWatch):</label><br />
                       @Html.EditorFor(model => model.IsShowWatch)
            </div>

        </div>
        <br class="clear" />
        <br />
            
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.TotalMark):</label><br />
                       @Model.TotalMark
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.SoldMark):</label><br />
                       @Model.SoldMark
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.LastLogin):</label><br />
                       @(vngoodlife.Util.GeneralClass.ConvertDate_1B(Model.LastLogin))
            </div>
            <div class="editor_right2">
                <label>@Html.LabelFor(model => model.LastLogout):</label><br />
                       @(vngoodlife.Util.GeneralClass.ConvertDate_1B(Model.LastLogout))
            </div>


        </div>
        <br class="clear" />
        <br />
            
        <div>
            <div class="editor_left2">
                <label>@Html.LabelFor(model => model.CreateDate):</label><br />
                       @(vngoodlife.Util.GeneralClass.ConvertDate_1B(Model.CreateDate))
            </div>
            <div class="editor_middle2">
                <label>@Html.LabelFor(model => model.EditDate):</label><br />
                       @(vngoodlife.Util.GeneralClass.ConvertDate_1B(Model.EditDate))
            </div>
            <div class="editor_middle2B">
                <label>@Html.LabelFor(model => model.UpdateMemberName):</label><br />
                       @Model.UpdateMemberName
            </div>

        </div>
        <br class="clear" />
        <br />
            
        @Html.HiddenFor(model => model.MemberName); 
        @Html.HiddenFor(model => model.Avatar);   
        
        <p>
            <input type="submit" value="Cập nhật Admin" style="margin: 0 2px" name="action" />
            <a href="@Url.Action("AdminEdit", "Admin", new { memberName = Model.MemberName })" class="button" >Làm lại</a>
        </p>
    
        }

    </div>
</div>